// Learn cc.Class:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        m_LevelBtn:cc.Button,
        m_LevelLock:cc.Node,
        m_LevelNum:cc.Label,
        m_HightLight:cc.Node,
        _level:0,
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {

    },

    start () {
        this.m_LevelBtn.node.on(cc.Node.EventType.TOUCH_START,this.touchStart,this) // 按下时事件
        this.m_LevelBtn.node.on(cc.Node.EventType.TOUCH_END,this.touchEnd,this) // 按下时事件
        this.m_LevelBtn.node.on(cc.Node.EventType.TOUCH_CANCEL,this.touchEnd,this) // 按下时事件
    },

    update (dt) {

    },
    touchStart:function(){
        this.m_HightLight.active = true;
    },
    touchEnd:function(){
        this.m_HightLight.active = false;
    },
    //初始化关卡数字
    initLevelNum:function(num){
        this.m_LevelNum.string = num;
        this._level = num;
    },
    //
    initLevelLock:function(isLock){
        this.m_LevelLock.active = isLock;
        this.m_LevelBtn.interactable = !isLock;
    },
    //点击关卡
    click_Level:function(){

    },
});
